package view.login
{
    import components.contorls.superClass.BaseButton;
    import components.contorls.superClass.BaseTextInput;
    import components.core.UIComponent;
    import components.utils.EventListenerUtil;
    
    import events.login.LoginEvent;
    
    import flash.events.MouseEvent;

    /**
     *登陆
     * @author zn
     *
     */
    [ExcludeClass]
    public class LoginComponent extends UIComponent implements ILoginComponent
    {
        public var userNameTextInput:BaseTextInput;

        public var passwordTextInput:BaseTextInput;

        public var submitButton:BaseButton;

        public function LoginComponent()
        {
            super();
			
			EventListenerUtil.addEventListener(submitButton,MouseEvent.CLICK, submitButton_clickHandler);
        }

        protected function submitButton_clickHandler(event:MouseEvent):void
        {
            dispatchEvent(new LoginEvent(LoginEvent.LOGIN_EVENT,userNameTextInput.text,passwordTextInput.text));
        }

    }
}